<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .btn{
            width: 60px;
            height: 30px;
            background-color: rgb(243, 207, 207);
        }
        .box{
            width: 200px;
            height: 200px;
            background-color: rgb(172, 233, 159);
            transition: all 1s;
        }
        .btn:hover+.box{
            transform: translateX(400px);
        }
    </style>
</head>
<body>
    <div class="btn">直到我</div>
    <div class="box"></div>
    <script >
        const boxEle = document.querySelector('.box')
        boxEle.addEventListener('transitionstart',function(){
            console.log('开始过渡')
        })
        boxEle.ontransitionend = function(){
            console.log("结束过渡")
        }
    </script>
</body>
</html>